package com.ztools.pc.controller.coupon;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ztools.common.model.pc.coupon.CouponExpire;
import com.ztools.common.util.common.PageUtil;
import com.ztools.common.util.common.Result;
import com.ztools.pc.service.coupon.CouponExpireService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author: seeTools
 * @Date: 2023/5/19  22:57
 * @Version 1.0
 */
@RestController
@RequestMapping("/coupon/expire")
public class CouponExpireController {

    @Resource
    private CouponExpireService couponExpireService;

    @RequestMapping("/list")
    public Result findList(@RequestBody PageUtil<CouponExpire> pageUtil) {
        Page<CouponExpire> list = couponExpireService.findList(pageUtil);
        return list != null ? Result.success("查询成功").data(list) : Result.error();
    }

    @RequestMapping("/findByObject")
    public Result findByObject(@RequestBody CouponExpire couponExpire) {
        List<CouponExpire> list = couponExpireService.findByObject(couponExpire);
        return list != null ? Result.success("查询成功").data(list) : Result.error();
    }

}
